<?php defined('IN_IA') or exit('Access Denied');?><?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('base/common-header', TEMPLATE_INCLUDEPATH)) : (include template('base/common-header', TEMPLATE_INCLUDEPATH));?>


<!-- 搜索 -->
<form action="<?php  echo aurl('index')?>" method="GET" id="form_search" class="table-top-search form-inline" style="float: right;padding-bottom: 15px">

    <input type="text" name="mch_name" class="form-control" placeholder="搜索商家姓名" value="<?php  echo $_GET['mch_name'];?>">
    <input type="text" name="active_name" class="form-control" placeholder="搜索活动名称" value="<?php  echo $_GET['active_name'];?>">
    <button class="btn btn-warning">搜索</button>
</form>

    <form action="javascript:void(0)" method="POST" id="form">
        <table class="table table-hover">
            <thead>
                <tr>
                    <th>ID</th>
                    <th>商家姓名</th>
                    <th>手机号</th>
                    <th>行业</th>
                    <th>活动</th>
                    <!-- <th>地址</th> -->
                    <th>加盟时间</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                <?php  if(is_array($list)) { foreach($list as $index => $item) { ?>
                <tr>
                    <td><?php  echo $item['uni_id'];?></td>
                    <td><?php  echo $item['name'];?></td>
                    <td><?php  echo $item['mobile'];?></td>
                    <td><?php  echo $item['industry_name'];?></td>
                    <td><?php  echo $item['active_name'];?></td>
                    <!-- <td><?php  echo $item['address'];?></td> -->
                    <td><?php  echo date('Y-m-d H:i', $item['create_time'])?></td>
                    <td>
                        <div>
                            <?php  echo $_W['NS']['mch_apply_status'][$item['status']];?>
                            <!-- <?php  echo $item['status'];?> -->
                            <!-- <?php  echo $item['title'];?> -->
                        </div>
                        <!-- <?php  echo $item['status'];?> -->
                    </td>
                    <td>
                        <div><a href="<?php  echo aurl('mchMessage',['mchid'=>$item['id']])?>" class="a a-hover label label-warning">查看</a></div>
                        <div><a href="javascript:;" class="cliplink" data-text="<?php  echo web2app_url('Main', ['et' => 'newjoin', 'apply_id' => $item['id'],'pid' => $item['active_id']])?>">点击复制手机修改链接</a></div>
                    </td>
                </tr>
                <?php  } } ?>
            </tbody>
        </table>
        <?php  echo $page;?>
    </form>
    <script>
            requirejs.config({
                appDir: '.',
                paths: {
                    'clipboard': ['<?php echo WEB_RESOURCE;?>/lib/clipboard.min']
                }
            });
            require(['jquery', 'clipboard'], function ($, Clipboard) {
        
                var clipboard = new Clipboard('.cliplink', {
                    text: function (e) {
                        return $(e).attr('data-text');
                    }
                });
        
                clipboard.on('success', function (e) {
                    xalert('复制成功', true, true);
                });
                clipboard.on('error', function () {
                    xalert('复制失败', false, true);
                });
            });
        
        </script>
    <?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('base/common-footer', TEMPLATE_INCLUDEPATH)) : (include template('base/common-footer', TEMPLATE_INCLUDEPATH));?>
<script>var we7CommonForModule = document.createElement("script");we7CommonForModule.src = '//cdn.w7.cc/we7/w7windowside.js?v=201904260003';document.body.appendChild(we7CommonForModule)
</script>